<template>
	<view>
		<view class="nav-bar">
			<view class="left">
				<image src="../../../static/back_icon.png" @tap="back" mode=""></image>
			</view>
			<view class="center">
				余额提现
			</view>
			<view class="right" @tap="income">
				我的银行卡
			</view>
		</view>
		<view class="money-pan">
			<view class="pan">
				<view class="top" @tap="chooseBank">
					<view class="left">
						体现至
					</view>
					<view class="right">
						招商银行储蓄卡(7117)
						<image src="../../../static/earnings/arrow-right.png" mode=""></image>
					</view>
				</view>
				<view class="yue">
					提现余额
				</view>
				<view class="middle">
					<view class="icon-mon">￥</view>
					<input class="input" v-model="moeny" @input="show" type="digit" focus value="" />
				</view>
				<view class="btn" :class="showed?'opct':''" @tap="request">
					确认提现
				</view>
			</view>
		</view>
		<!-- 提现提示 -->
		<tui-modal :show="modal" :custom="true" :maskClosable="false">
			<view class="content">
				<view class="top">
					<image src="../../../static/earnings/success_tips.png" mode=""></image>
				</view>
				<view class="middle">提现申请已提交，请耐心等待</view>
				<view class="bottom" @tap="hide">完成</view>
			</view>
		</tui-modal>
	</view>
</template>

<script>
	import tuiModal from "@/components/modal/modal.vue"
	export default {
		components: {
			tuiModal
		},
		data() {
			return {
				moeny: '',
				showed: false,
				modal: false,
			}
		},
		methods: {
			//导航方法
			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			// 我的银行卡
			income() {
				uni.navigateTo({
					url:'/pages/earnings/bankCardList/bankCardList'
				})
			},
			//提现银行卡
			chooseBank() {
				uni.redirectTo({
					url:'/pages/earnings/bankCardList/bankCardList'
				})
			},
			show(event) {
				if (event.target.value.length > 0) {
					this.showed = true;
				} else {
					this.showed = false;
				}
			},
			request() {
				if (this.showed) {
					uni.showToast({
						title: ":ss"
					});
					this.modal = true;
				}
			},
			hide() {
				this.modal = false;
			},
		}
	}
</script>

<style scoped lang="scss">
	.nav-bar {
		height: 128upx;
		padding: 40upx 28upx 0;
		background: #E8271B;
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: fixed;
		width: 750upx;
		z-index: 9;

		.left {
			width: 160upx;

			image {
				display: block;
				width: 48upx;
				height: 48upx;
			}
		}

		.center {
			width: 144upx;
			line-height: 70px;
			font-size: 36upx;
			font-weight: 500;
			color: rgba(255, 255, 255, 1);
		}

		.right {
			width: 160upx;
			font-size: 32upx;
			font-weight: 500;
			line-height: 70px;
			color: rgba(255, 255, 255, 1);
		}
	}

	.money-pan {
		padding-top: 160upx;
		margin: 0 auto;
		width: 694upx;

		.pan {
			height: 536upx;
			background: rgba(255, 255, 255, 1);
			border-radius: 20upx;
			padding: 36upx 40upx 75upx;

			.top {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding-bottom: 5upx;
				border-bottom: 1upx solid #F2F2F2;

				.left {
					font-size: 28upx;
					font-weight: 500;
					color: rgba(153, 153, 153, 1);
				}

				.right {
					display: flex;
					align-items: center;

					image {
						display: block;
						width: 22upx;
						height: 22upx;
						margin-left: 10upx;
					}
				}
			}

			.yue {
				margin-top: 40upx;
				font-size: 32upx;
				font-weight: 500;
				color: rgba(77, 77, 77, 1);
			}

			.middle {
				margin-top: 20upx;
				display: flex;
				align-items: flex-end;
				border-bottom: 1upx solid #F2F2F2;

				.icon-mon {
					font-size: 60upx;
					height: 102upx;
					font-weight: bold;
					color: rgba(51, 51, 51, 1);
				}

				.input {
					display: flex;
					align-items: flex-end;
					display: block;
					font-size: 80upx;
					height: 80upx;
					padding-left: 10upx;
				}
			}

			.btn {
				margin: 45upx auto 0;
				text-align: center;
				width: 100%;
				height: 104upx;
				background: rgba(232, 39, 27, 1);
				opacity: 0.5;
				border-radius: 52upx;
				font-size: 40upx;
				font-weight: 500;
				line-height: 104upx;
				color: rgba(255, 255, 255, 1);
			}

			.opct {
				opacity: 1;
			}
		}
	}

	.content {
		.top {
			image {
				width: 72upx;
				height: 72upx;
				display: block;
				margin: 0 auto;
			}
		}

		.middle {
			height: 120upx;
			font-size: 34upx;
			font-weight: 500;
			line-height: 120upx;
			color: rgba(51, 51, 51, 1);
			text-align: center;
		}

		.bottom {
			height: 60upx;
			font-size: 34upx;
			font-weight: 500;
			color: rgba(51, 51, 51, 1);
			padding-top: 10upx;
			margin: 0 -12%;
			border-top: 1upx solid #F2F2F2;
			text-align: center;
		}
	}
</style>
